gint pixbuf_height = 0;
gint calc_width;
gint calc_height;
+ gint xpad, ypad;
priv = GTK_CELL_RENDERER_PIXBUF_GET_PRIVATE (cell);
pixbuf_width = MAX (pixbuf_width, gdk_pixbuf_get_width (cellpixbuf->pixbuf_expander_closed));
pixbuf_height = MAX (pixbuf_height, gdk_pixbuf_get_height (cellpixbuf->pixbuf_expander_closed));
}
-
- calc_width = (gint) cell->xpad * 2 + pixbuf_width;
- calc_height = (gint) cell->ypad * 2 + pixbuf_height;
+
+ gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
+ calc_width = (gint) xpad * 2 + pixbuf_width;
+ calc_height = (gint) ypad * 2 + pixbuf_height;
if (cell_area && pixbuf_width > 0 && pixbuf_height > 0)
{
+ gfloat xalign, yalign;
+
+ gtk_cell_renderer_get_alignment (cell, &xalign, &yalign);
if (x_offset)
{
*x_offset = (((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ?
- (1.0 - cell->xalign) : cell->xalign) *
+ (1.0 - xalign) : xalign) *
(cell_area->width - calc_width));
*x_offset = MAX (*x_offset, 0);
}
if (y_offset)
{
- *y_offset = (cell->yalign *
+ *y_offset = (yalign *
(cell_area->height - calc_height));
*y_offset = MAX (*y_offset, 0);
}
GdkRectangle pix_rect;
GdkRectangle draw_rect;
cairo_t *cr;
+ gboolean is_expander;
+ gint xpad, ypad;
priv = GTK_CELL_RENDERER_PIXBUF_GET_PRIVATE (cell);
&pix_rect.width,
&pix_rect.height);
- pix_rect.x += cell_area->x + cell->xpad;
- pix_rect.y += cell_area->y + cell->ypad;
- pix_rect.width -= cell->xpad * 2;
- pix_rect.height -= cell->ypad * 2;
+ gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
+ pix_rect.x += cell_area->x + xpad;
+ pix_rect.y += cell_area->y + ypad;
+ pix_rect.width -= xpad * 2;
+ pix_rect.height -= ypad * 2;
if (!gdk_rectangle_intersect (cell_area, &pix_rect, &draw_rect) ||
!gdk_rectangle_intersect (expose_area, &draw_rect, &draw_rect))
pixbuf = cellpixbuf->pixbuf;
- if (cell->is_expander)
+ g_object_get (cell, "is-expander", &is_expander, NULL);
+ if (is_expander)
{
- if (cell->is_expanded &&
+ gboolean is_expanded;
+
+ g_object_get (cell, "is-expanded", &is_expanded, NULL);
+
+ if (is_expanded &&
cellpixbuf->pixbuf_expander_open != NULL)
pixbuf = cellpixbuf->pixbuf_expander_open;
- else if (!cell->is_expanded &&
+ else if (!is_expanded &&
cellpixbuf->pixbuf_expander_closed != NULL)
pixbuf = cellpixbuf->pixbuf_expander_closed;
}
if (!pixbuf)
return;
- if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE || !cell->sensitive)
+ if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE ||
+ !gtk_cell_renderer_get_sensitive (cell))
{
GtkIconSource *source;
{
PangoRectangle logical_rect;
PangoLayout *layout;
+ gint xpad, ypad;
layout = gtk_widget_create_pango_layout (widget, text);
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
+
+ gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
if (width)
- *width = logical_rect.width + cell->xpad * 2;
+ *width = logical_rect.width + xpad * 2;
if (height)
- *height = logical_rect.height + cell->ypad * 2;
+ *height = logical_rect.height + ypad * 2;
g_object_unref (layout);
}
PangoLayout *layout;
PangoRectangle logical_rect;
gint x, y, w, h, x_pos, y_pos, bar_position, bar_size, start, full_size;
+ gint xpad, ypad;
GdkRectangle clip;
gboolean is_rtl;
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
-
- x = cell_area->x + cell->xpad;
- y = cell_area->y + cell->ypad;
- w = cell_area->width - cell->xpad * 2;
- h = cell_area->height - cell->ypad * 2;
+
+ gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
+ x = cell_area->x + xpad;
+ y = cell_area->y + ypad;
+ w = cell_area->width - xpad * 2;
+ h = cell_area->height - ypad * 2;
/* FIXME: GtkProgressBar draws the box with "trough" detail,
* but some engines don't paint anything with that detail for
}
state = GTK_STATE_NORMAL;
- if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE || !cellr->sensitive)
+ if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE ||
+ !gtk_cell_renderer_get_sensitive (cellr))
{
state = GTK_STATE_INSENSITIVE;
}
gtk_cell_renderer_text_init (GtkCellRendererText *celltext)
{
GtkCellRendererTextPrivate *priv;
+ GtkCellRenderer *cell = GTK_CELL_RENDERER (celltext);
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (celltext);
- GTK_CELL_RENDERER (celltext)->xalign = 0.0;
- GTK_CELL_RENDERER (celltext)->yalign = 0.5;
- GTK_CELL_RENDERER (celltext)->xpad = 2;
- GTK_CELL_RENDERER (celltext)->ypad = 2;
+ gtk_cell_renderer_set_alignment (cell, 0.0, 0.5);
+ gtk_cell_renderer_set_padding (cell, 2, 2);
celltext->font_scale = 1.0;
celltext->fixed_height_rows = -1;
celltext->font = pango_font_description_new ();
celltext->editable = g_value_get_boolean (value);
celltext->editable_set = TRUE;
if (celltext->editable)
- GTK_CELL_RENDERER (celltext)->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
+ g_object_set (celltext, "mode", GTK_CELL_RENDERER_MODE_EDITABLE, NULL);
else
- GTK_CELL_RENDERER (celltext)->mode = GTK_CELL_RENDERER_MODE_INERT;
+ g_object_set (celltext, "mode", GTK_CELL_RENDERER_MODE_INERT, NULL);
g_object_notify (object, "editable-set");
break;
GtkCellRendererText *celltext = (GtkCellRendererText *) cell;
PangoRectangle rect;
GtkCellRendererTextPrivate *priv;
+ gint xpad, ypad;
+ gint cell_width, cell_height;
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
+ gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
+
if (celltext->calc_fixed_height)
{
PangoContext *context;
pango_font_description_free (font_desc);
+ gtk_cell_renderer_get_fixed_size (cell, &cell_width, &cell_height);
+
gtk_cell_renderer_set_fixed_size (cell,
- cell->width, 2*cell->ypad +
+ cell_width, 2 * ypad +
celltext->fixed_height_rows * PANGO_PIXELS (row_height));
if (height)
{
- *height = cell->height;
+ *height = cell_height;
height = NULL;
}
celltext->calc_fixed_height = FALSE;
pango_layout_get_pixel_extents (layout, NULL, &rect);
if (height)
- *height = cell->ypad * 2 + rect.height;
+ *height = ypad * 2 + rect.height;
/* The minimum size for ellipsized labels is ~ 3 chars */
if (width)
char_width = pango_font_metrics_get_approximate_char_width (metrics);
pango_font_metrics_unref (metrics);
- *width = cell->xpad * 2 + (PANGO_PIXELS (char_width) * MAX (priv->width_chars, 3));
+ *width = xpad * 2 + (PANGO_PIXELS (char_width) * MAX (priv->width_chars, 3));
}
else
{
- *width = cell->xpad * 2 + rect.x + rect.width;
+ *width = xpad * 2 + rect.x + rect.width;
}
}
if (cell_area)
{
+ gfloat xalign, yalign;
+
+ gtk_cell_renderer_get_alignment (cell, &xalign, &yalign);
+
if (x_offset)
{
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- *x_offset = (1.0 - cell->xalign) * (cell_area->width - (rect.x + rect.width + (2 * cell->xpad)));
+ *x_offset = (1.0 - xalign) * (cell_area->width - (rect.x + rect.width + (2 * xpad)));
else
- *x_offset = cell->xalign * (cell_area->width - (rect.x + rect.width + (2 * cell->xpad)));
+ *x_offset = xalign * (cell_area->width - (rect.x + rect.width + (2 * xpad)));
if ((priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE) || priv->wrap_width != -1)
*x_offset = MAX(*x_offset, 0);
}
if (y_offset)
{
- *y_offset = cell->yalign * (cell_area->height - (rect.height + (2 * cell->ypad)));
+ *y_offset = yalign * (cell_area->height - (rect.height + (2 * ypad)));
*y_offset = MAX (*y_offset, 0);
}
}
GtkStateType state;
gint x_offset;
gint y_offset;
+ gint xpad, ypad;
GtkCellRendererTextPrivate *priv;
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
layout = get_layout (celltext, widget, TRUE, flags);
get_size (cell, widget, cell_area, layout, &x_offset, &y_offset, NULL, NULL);
- if (!cell->sensitive)
+ if (!gtk_cell_renderer_get_sensitive (cell))
{
state = GTK_STATE_INSENSITIVE;
}
cairo_destroy (cr);
}
+ gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
+
if (priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE)
pango_layout_set_width (layout,
- (cell_area->width - x_offset - 2 * cell->xpad) * PANGO_SCALE);
+ (cell_area->width - x_offset - 2 * xpad) * PANGO_SCALE);
else if (priv->wrap_width == -1)
pango_layout_set_width (layout, -1);
expose_area,
widget,
"cellrenderertext",
- cell_area->x + x_offset + cell->xpad,
- cell_area->y + y_offset + cell->ypad,
+ cell_area->x + x_offset + xpad,
+ cell_area->y + y_offset + ypad,
layout);
g_object_unref (layout);
GtkRequisition requisition;
GtkCellRendererText *celltext;
GtkCellRendererTextPrivate *priv;
+ gfloat xalign, yalign;
celltext = GTK_CELL_RENDERER_TEXT (cell);
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
if (celltext->editable == FALSE)
return NULL;
- priv->entry = g_object_new (GTK_TYPE_ENTRY,
- "has-frame", FALSE,
- "xalign", cell->xalign,
- NULL);
+ gtk_cell_renderer_get_alignment (cell, &xalign, &yalign);
+
+ priv->entry = gtk_entry_new ();
+ gtk_entry_set_has_frame (GTK_ENTRY (priv->entry), FALSE);
+ gtk_entry_set_alignment (GTK_ENTRY (priv->entry), xalign);
if (celltext->text)
gtk_entry_set_text (GTK_ENTRY (priv->entry), celltext->text);
gtk_cell_renderer_text_set_fixed_height_from_font (GtkCellRendererText *renderer,
gint number_of_rows)
{
+ GtkCellRenderer *cell;
+
g_return_if_fail (GTK_IS_CELL_RENDERER_TEXT (renderer));
g_return_if_fail (number_of_rows == -1 || number_of_rows > 0);
+ cell = GTK_CELL_RENDERER (renderer);
+
if (number_of_rows == -1)
{
- gtk_cell_renderer_set_fixed_size (GTK_CELL_RENDERER (renderer),
- GTK_CELL_RENDERER (renderer)->width,
- -1);
+ gint width, height;
+
+ gtk_cell_renderer_get_fixed_size (cell, &width, &height);
+ gtk_cell_renderer_set_fixed_size (cell, width, -1);
}
else
{
celltoggle->active = FALSE;
celltoggle->radio = FALSE;
- GTK_CELL_RENDERER (celltoggle)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
- GTK_CELL_RENDERER (celltoggle)->xpad = 2;
- GTK_CELL_RENDERER (celltoggle)->ypad = 2;
+ g_object_set (celltoggle, "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL);
+ gtk_cell_renderer_set_padding (GTK_CELL_RENDERER (celltoggle), 2, 2);
priv->indicator_size = TOGGLE_WIDTH;
priv->inconsistent = FALSE;
{
gint calc_width;
gint calc_height;
+ gint xpad, ypad;
GtkCellRendererTogglePrivate *priv;
priv = GTK_CELL_RENDERER_TOGGLE_GET_PRIVATE (cell);
- calc_width = (gint) cell->xpad * 2 + priv->indicator_size;
- calc_height = (gint) cell->ypad * 2 + priv->indicator_size;
+ gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
+ calc_width = xpad * 2 + priv->indicator_size;
+ calc_height = ypad * 2 + priv->indicator_size;
if (width)
*width = calc_width;
if (cell_area)
{
+ gfloat xalign, yalign;
+
+ gtk_cell_renderer_get_alignment (cell, &xalign, &yalign);
+
if (x_offset)
{
*x_offset = ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ?
- (1.0 - cell->xalign) : cell->xalign) * (cell_area->width - calc_width);
+ (1.0 - xalign) : xalign) * (cell_area->width - calc_width);
*x_offset = MAX (*x_offset, 0);
}
if (y_offset)
{
- *y_offset = cell->yalign * (cell_area->height - calc_height);
+ *y_offset = yalign * (cell_area->height - calc_height);
*y_offset = MAX (*y_offset, 0);
}
}
GtkCellRendererTogglePrivate *priv;
gint width, height;
gint x_offset, y_offset;
+ gint xpad, ypad;
GtkShadowType shadow;
GtkStateType state = 0;
gtk_cell_renderer_toggle_get_size (cell, widget, cell_area,
&x_offset, &y_offset,
&width, &height);
- width -= cell->xpad*2;
- height -= cell->ypad*2;
+ gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
+ width -= xpad * 2;
+ height -= ypad * 2;
if (width <= 0 || height <= 0)
return;
else
shadow = celltoggle->active ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
- if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE || !cell->sensitive)
+ if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE ||
+ !gtk_cell_renderer_get_sensitive (cell))
{
state = GTK_STATE_INSENSITIVE;
}
window,
state, shadow,
expose_area, widget, "cellradio",
- cell_area->x + x_offset + cell->xpad,
- cell_area->y + y_offset + cell->ypad,
+ cell_area->x + x_offset + xpad,
+ cell_area->y + y_offset + ypad,
width, height);
}
else
window,
state, shadow,
expose_area, widget, "cellcheck",
- cell_area->x + x_offset + cell->xpad,
- cell_area->y + y_offset + cell->ypad,
+ cell_area->x + x_offset + xpad,
+ cell_area->y + y_offset + ypad,
width, height);
}
}
gint width, height;
GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
if (!first_cell)
{
GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
if (info->expand)
{
GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
info->real_width = info->requested_width +
if (info->pack == GTK_PACK_END)
continue;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
area.width = info->real_width;
if (info->pack == GTK_PACK_START)
continue;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
area.width = info->real_width;
static void
set_icon_cell_renderer_fixed_size (GtkFileChooserDefault *impl, GtkCellRenderer *renderer)
{
+ gint xpad, ypad;
+
+ gtk_cell_renderer_get_padding (renderer, &xpad, &ypad);
gtk_cell_renderer_set_fixed_size (renderer,
- renderer->xpad * 2 + impl->icon_size,
- renderer->ypad * 2 + impl->icon_size);
+ xpad * 2 + impl->icon_size,
+ ypad * 2 + impl->icon_size);
}
/* Creates the widgets for the file list */
{
GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
gtk_icon_view_get_cell_box (icon_view, item, info, &box);
{
GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
gtk_cell_renderer_get_size (info->cell, GTK_WIDGET (icon_view),
if (info->pack == (k ? GTK_PACK_START : GTK_PACK_END))
continue;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
gtk_icon_view_get_cell_area (icon_view, item, info, &cell_area);
{
for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++)
{
+ GtkCellRendererMode mode;
GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
/* If found a editable/activatable cell, draw focus on it. */
+ g_object_get (info->cell, "mode", &mode, NULL);
if (icon_view->priv->cursor_cell < 0 &&
- info->cell->mode != GTK_CELL_RENDERER_MODE_INERT)
+ mode != GTK_CELL_RENDERER_MODE_INERT)
icon_view->priv->cursor_cell = i;
gtk_icon_view_get_cell_box (icon_view, item, info, &box);
{
GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
gtk_icon_view_get_cell_box (icon_view, item, info, &box);
for (k = 0; k < 2; k++)
for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++)
{
+ GtkCellRendererMode mode;
GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
if (info->pack == (k ? GTK_PACK_START : GTK_PACK_END))
continue;
- if (!info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
- if (info->cell->mode != GTK_CELL_RENDERER_MODE_INERT)
+ g_object_get (info->cell, "mode", &mode, NULL);
+ if (mode != GTK_CELL_RENDERER_MODE_INERT)
{
if (cell == i)
current = n_focusable;
gboolean
_gtk_tree_view_column_has_editable_cell (GtkTreeViewColumn *column)
{
+ GtkCellRenderer *cell;
+ GtkCellRendererMode mode;
GList *list;
for (list = column->cell_list; list; list = list->next)
- if (((GtkTreeViewColumnCellInfo *)list->data)->cell->mode ==
- GTK_CELL_RENDERER_MODE_EDITABLE)
- return TRUE;
+ {
+ cell = ((GtkTreeViewColumnCellInfo *)list->data)->cell;
+ g_object_get (cell, "mode", &mode, NULL);
+ if (mode == GTK_CELL_RENDERER_MODE_EDITABLE)
+ return TRUE;
+ }
return FALSE;
}
for (list = column->cell_list; list; list = list->next)
{
+ GtkCellRendererMode mode;
GtkTreeViewColumnCellInfo *cellinfo = list->data;
- if ((cellinfo->cell->mode == GTK_CELL_RENDERER_MODE_EDITABLE ||
- cellinfo->cell->mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE) &&
- cellinfo->cell->visible)
+ g_object_get (cellinfo->cell, "mode", &mode, NULL);
+ if ((mode == GTK_CELL_RENDERER_MODE_EDITABLE ||
+ mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE) &&
+ gtk_cell_renderer_get_visible (cellinfo->cell))
i++;
}
GSList *list;
GValue value = { 0, };
GList *cell_list;
+ gboolean cell_is_expander, cell_is_expanded;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
g_object_freeze_notify (cell);
- if (info->cell->is_expander != is_expander)
+ g_object_get (cell, "is-expander", &cell_is_expander, NULL);
+ if (cell_is_expander != is_expander)
g_object_set (cell, "is-expander", is_expander, NULL);
- if (info->cell->is_expanded != is_expanded)
+ g_object_get (cell, "is-expanded", &cell_is_expanded, NULL);
+ if (cell_is_expanded != is_expanded)
g_object_set (cell, "is-expanded", is_expanded, NULL);
while (list && list->next)
{
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *)list->data;
- if (! info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
if (info->expand == TRUE)
if (info->pack == GTK_PACK_END)
continue;
- if (! info->cell->visible)
+ if (!gtk_cell_renderer_get_visible (info->cell))
continue;
if ((info->has_focus || special_cells == 1) && cursor_row)
if (info->pack == GTK_PACK_START)
continue;
- if (! info->cell->visible)
+ if (!gtk_cell_renderer_get_visible(info->cell))
continue;
if ((info->has_focus || special_cells == 1) && cursor_row)
{
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
- if (info->cell->visible)
+ if (gtk_cell_renderer_get_visible (info->cell))
return TRUE;
}
if (info->cell == cell)
break;
- if (info->cell->visible)
+ if (gtk_cell_renderer_get_visible (info->cell))
l += info->real_width + column->spacing;
}
list = gtk_tree_view_column_cell_next (column, list);
- if (info->cell->visible)
+ if (gtk_cell_renderer_get_visible (info->cell))
r += info->real_width + column->spacing;
}
break;
}
- if (cellinfo->cell->visible)
+ if (gtk_cell_renderer_get_visible (cellinfo->cell))
current_x += cellinfo->real_width;
}
PangoRectangle char_rect;
PangoLayout *layout;
gint x_offset, y_offset, index, cell_height, cell_width;
+ gint xpad, ypad;
if (!GAIL_TEXT_CELL (text)->cell_text)
{
offset) - gtk_renderer->text;
pango_layout_index_to_pos (layout, index, &char_rect);
+ gtk_cell_renderer_get_padding (gail_renderer->renderer, &xpad, &ypad);
gail_misc_get_extents_from_pango_rectangle (widget,
&char_rect,
- x_offset + rendered_rect.x + gail_renderer->renderer->xpad,
- y_offset + rendered_rect.y + gail_renderer->renderer->ypad,
+ x_offset + rendered_rect.x + xpad,
+ y_offset + rendered_rect.y + ypad,
x, y, width, height, coords);
g_object_unref (layout);
return;
GdkRectangle rendered_rect;
PangoLayout *layout;
gint x_offset, y_offset, index;
+ gint xpad, ypad;
if (!GAIL_TEXT_CELL (text)->cell_text)
return -1;
&rendered_rect, &x_offset, &y_offset, NULL, NULL);
layout = create_pango_layout (gtk_renderer, widget);
-
+
+ gtk_cell_renderer_get_padding (gail_renderer->renderer, &xpad, &ypad);
index = gail_misc_get_index_at_point_in_layout (widget, layout,
- x_offset + rendered_rect.x + gail_renderer->renderer->xpad,
- y_offset + rendered_rect.y + gail_renderer->renderer->ypad,
+ x_offset + rendered_rect.x + xpad,
+ y_offset + rendered_rect.y + ypad,
x, y, coords);
g_object_unref (layout);
if (index == -1)